package com.kichina.parking.utils;

/**
 * @author Surging
 * @version 1.0
 * @ClassName StrTest
 * @date 2022-09-19 17:06
 * @desc
 */
public class StrTest {

    public static void main(String[] args) {
//java截取某个字符之后的字符串

            String str = "test__https://www.baidu.com/!";
            System.out.println("字符串长度:"+str.length());
            System.out.println("-----下标:"+str.indexOf("_"));
            System.out.println("-----下标:"+str.indexOf("!"));
            //截取_之后字符串
            String str1 = str.substring(0, str.indexOf("_")+1);
            System.out.println("截取_之前字符串:"+str1);
            String str2 = str.substring(str.indexOf("_") + 1, str.length());
            System.out.println("截取_之后字符串:"+str2);

    }
}
